import http from '../httpInstance'
// import { AxiosPromise } from 'axios';
import type {TrafficRankingRspDtoResponseResult, CurrentTimeReqDto,
  CircleStatisticsRspDtoRespSult, OnlineTrendRspDtoRespSult } from './types'

// 查询岗位的数据字典
export function queryRolesService (data: any) {
  return http({
    method: 'get',
    url: '/ctm01ssed/ui/v1/user/queryRoles',
    data
  })
}


/* ******************** 两客一危 ********************** */

// 危化品车辆高配路段top5
// export const getDangerRoadTop5Service = (data): AxiosPromise<TrafficRankingRspDtoResponseResult> => {
export const getDangerRoadTop5Service = (data: CurrentTimeReqDto): Promise<TrafficRankingRspDtoResponseResult> => {
  return http({
    method: 'post',
    data,
    url: '/lsbdb/api/v1/common/twoCustomers/getDangerRoadTop5'
  })
}
// 两客一危在线数
export const getOnlineProportionService = (data: CurrentTimeReqDto): Promise<CircleStatisticsRspDtoRespSult> => {
  return http({
    method: 'post',
    data,
    url: '/lsbdb/api/v1/common/twoCustomers/getOnlineProportion'
  })
}
// 车辆在线变化趋势
export const getOnlineTrendService = (data: CurrentTimeReqDto): Promise<OnlineTrendRspDtoRespSult> => {
  return http({
    method: 'post',
    data,
    url: '/lsbdb/api/v1/common/twoCustomers/getOnlineTrend'
  })
}

export default {
  getDangerRoadTop5Service,
  getOnlineProportionService,
  getOnlineTrendService,
  queryRolesService,
}
